package com.fintech.third.service.moxie;

import com.fintech.third.model.moxie.insurance.InsurancePolicy;
import com.fintech.third.service.moxie.task.TaskCreateReq;
import com.fintech.third.service.moxie.task.TaskCreateRsp;
import com.fintech.third.service.moxie.task.TaskStatusRsp;
import com.fintech.third.service.moxie.task.UserInput;

import net.sf.json.JSONObject;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;

/**
 * 车险保单
 */
public interface InsurancePolicyApi {
    /**
     * 创建任务
     *
     * @param req
     * @return
     */
    @POST("/gateway/v1/tasks")
    Call<TaskCreateRsp> createTask(@Body JSONObject josn);


    /**
     * 查询任务状态
     *
     * @param taskId
     * @return
     */
    @GET("/gateway/v1/tasks/{taskid}/status")
    Call<TaskStatusRsp> getTaskStatus(@Path("taskid") String taskId);
    
    /**
     * 查询任务状态
     *
     * @param taskId
     * @return
     */
    @POST("/gateway/v1/tasks/{task_id}/input")
    Call<Void> input(@Path("taskid") String taskId, @Body UserInput input);

    /**
     * 查询保单
     *
     * @param taskId
     * @return
     */
    @GET("/gateway/insurancepolicy/v2/policy/{taskid}")
    Call<InsurancePolicy> getPolicy(@Path("taskid") String taskId);
}
